package com.yigerende.dao;





import com.yigerende.model.Tag;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;


public interface TagRepository extends JpaRepository<Tag,Long> {

    public Tag findByName(String name);

    //通过每一个标签有多少个博客数量来排序的(index页面右边)
    @Query("select t from Tag t")//自定义查询
    public List<Tag> findTop(Pageable pageable);
}
